classdef map <handle
    %Represents the map showing current status of the simulation.
    
    methods(Static)
        
        %Generates a map from the provided data.
        function [p] = generateMap(r,A,B,C,D)
            dlnode currentNode;
            firstAdded = 0;
            [Am,An] = size(A);
            for i=1:1:Am
                for j=1:1:An
                    if (A(i,j) ~= 0)
                        r = road(i,j,B(i,j),C(i,j),D(i,j));   
                        if (firstAdded == 0)
                        currentNode = dlnode(r);
                        firstAdded = 1;
                        else
                        newNode = dlnode(r);
                        currentNode.insertAfter(newNode);
                        currentNode = newNode;
                        end
                    end
                    
                end
            end
            
        end
        
        %Updates the map to the current state of  the traffic.
        function updateMap(roads)
            
        end
    end
end    